using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;

namespace Crawler.DataServices.Persistence.nHibernate.Conventions
{
	public class CascadeConvention : IReferenceConvention, IHasManyConvention, IHasManyToManyConvention
	{
		public void Apply(IOneToManyCollectionInstance instance)
		{
			instance.Cascade.All();
		}

		public void Apply(IManyToManyCollectionInstance instance)
		{
			instance.Cascade.All();
		}

		public void Apply(IManyToOneInstance instance)
		{
			instance.Cascade.All();
		}
	}
}